<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

	<div id="editForProjectMilestoneDelayApply" class="easyui-window" title="审核项目节点完结申请" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:690px; height:460px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center'" style="padding:10px;">
				<form id="editForProjectMilestoneDelayApplyForm" method="post" action="checkProjectMilestoneDelay" style = "width:100%; height: 100%">
					<input type="hidden" id="projectMilestoneDelayApplyId" name = "id"/>
					<input type="hidden" id="projectMilestoneDelayApplyStatus" name = "status" value="3000"/>
					<input type="hidden" id="projectMilestoneDelayApplyProjectMilestoneId" name = "projectMilestone.id"/>
					<input type="hidden" id="projectMilestoneDelayApplyProjectMilestoneStatus" name = "projectMilestone.status" value="0055"/>
					
					<table width="100%" height="100%">
						<tr>
							<td width="130px;" align="right">项目名称：</td>
							<td width="160px">
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneDelayApplyProjectName" style="width: 200px;"/>
							</td>
							<td width="130px;" align="right">节点名称：</td>
							<td>
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneDelayApplyProjectMilestoneName" style="width: 200px;" />							
							</td>
						</tr>
						<tr>
							<td width="130px;" align="right">申请人：</td>
							<td>
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneDelayApplyApplyPersonName" style="width: 200px;" />							
							</td>
							<td align="right">申请时间：</td>
							<td>
								<input class="easyui-datetimebox" readonly="readonly" name="applyTime" id="projectMilestoneDelayApplyApplyTime" style="width: 200px;"/>
							</td>
						</tr>
						<tr>
							<td align="right">申请说明：</td>
							<td colspan="3">
								<input class="easyui-textbox"  readonly="readonly" data-options="multiline:true" style="width: 550px; height: 100px;" id="projectMilestoneDelayApplyApplyDescription" />
							</td>
						</tr>
						<tr>
							<td width="130px;" align="right">调整前日期：</td>
							<td>
							<input class="easyui-datetimebox" readonly="readonly" name="originalDate" id="projectMilestoneDelayApplyOriginalDate" style="width: 200px;" />							
							</td>
							<td align="right">调整后日期：</td>
							<td>
								<input class="easyui-datetimebox" readonly="readonly" name="targetDate" id="projectMilestoneDelayApplyTargetDate" style="width: 200px;"/>
							</td>
						</tr>
						<tr>
							<td align="right">审核意见：</td>
							<td colspan="3">
								<input class="easyui-textbox" data-options="multiline:true" style="width: 550px; height: 120px;" name="checkComment" id="projectMilestoneDelayApplyCheckComment" />
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editForProjectMilestoneDelayApplyForm').submit()" style="width:80px">通过</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#projectMilestoneDelayApplyStatus').val('2001');$('#editForProjectMilestoneDelayApplyForm').submit()" style="width:80px">驳回</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editForProjectMilestoneDelayApply').window('close')" style="width:80px">关 闭</a>
			</div>
		</div>
	</div>

	
	<script type="text/javascript">
	function editForProjectMilestoneDelayApply(id){
		$.ajax({ url: "getProjectMilestoneChange?id="+id, success: function(data){
			clearForm("editForProjectMilestoneDelayApplyForm", "editForProjectMilestoneDelayApply");
			
			var val = $.parseJSON(data);
			$("#projectMilestoneDelayApplyProjectName").textbox("setValue",val.projectName);
			$("#projectMilestoneDelayApplyApplyPersonName").textbox("setValue",val.applyPersonName);
			$("#projectMilestoneDelayApplyApplyTime").textbox("setValue",val.applyTime);
			$("#projectMilestoneDelayApplyApplyDescription").textbox("setValue",val.applyReason);
			$("#projectMilestoneDelayApplyProjectMilestoneName").textbox("setValue",val.projectMilestoneName);
			$("#projectMilestoneDelayApplyOriginalDate").textbox("setValue",val.originalDate);
			$("#projectMilestoneDelayApplyTargetDate").textbox("setValue",val.targetDate);
			$("#projectMilestoneDelayApplyId").val(id);
			$("#projectMilestoneDelayApplyStatus").val("3000");
			$("#projectMilestoneDelayApplyProjectMilestoneId").val(val.projectMilestoneId);
			$("#projectMilestoneDelayApplyProjectMilestoneStatus").val("0055");
		}});
	}
	
	$("#editForProjectMilestoneDelayApplyForm").form({
		onSubmit: function(){
			var isValid = $(this).form('validate');
			return isValid;	// 返回false将停止form提交 
	    },
		success:function(data){
			var val = $.parseJSON(data);
			if(val.success){
				$('#dg').datagrid('reload');
				bottomRight('提示', '操作成功！');
				$('#editForProjectMilestoneDelayApply').window('close');
			}else{
				$.messager.alert("提示", val.msg, "error");
			}
		}
	});
	</script>